<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sites</title>
<link href="/css/admin.css" rel="stylesheet" type="text/css" />
<script src="/js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function () {
		$('.commonTable tr').hover(function () {
			$(this).css('background-color', '#ffffae');
		},
        function () {
        	$(this).css('background-color', '#FFFFFF');
        });
       });
	function addcol()
	{
		window.location = "/cms/addcol/<?=$sid?>/<?=$pid?>";
	}
	function editcol(cid)
	{
		window.location = "/cms/editcol/<?=$sid?>/" + cid;
	}
	function delcol(cid)
	{
		if(confirm('确定删除？'))
			window.location = "/cms/columns/<?=$sid?>/<?php echo(empty($pid)?0:$pid);?>/del/" + cid;
	}
	function viewchild(cid)
	{
		window.location = "/cms/columns/<?=$sid?>/" + cid;
	}
	function sortcol(){
		window.location = "/cms/columnsort/<?=$sid?>/<?=$pid?>";
	}
</script>
</head>
<body>
	<!-- <div style=" width:80px; float:right;"><a href="/cms/columns/<?=$sid?>/<?=$ppid?>" > &lt;&lt;返回上级</a></div>-->
	
	<div id="navtoprowtabs">
		<span class="span-title"><?=$curName?>:</span>
		<ul id="navtop">
			<li><a href="/cms/articles/<?=$pid?>">文档</a></li>
			<li><a id="navtopactivehome" href="#">子栏目</a></li>
		</ul>
	</div>
	<!--<div class="listTitle">当前栏目:&nbsp;<?=$curName?></div>-->
	<div class="btnDiv"><input type="button" value="添加子栏目" onclick="addcol()" />&nbsp;&nbsp;<input type="button" value="排序" onclick="sortcol()" /></div>
	<div><table class="commonTable" width="100%" cellspacing="0" cellpadding="5" >
	    <tr>
	    	<th width="40">编号</th>
		    <th>名称</th>	
			<th>描述</th>
			<th>状态</th>
			<th>标签</th>
		    <th width="60" >
		    </th>
	    </tr>
		<?php $i=0; foreach ($query->result_array() as $row){
			$i++;
			?>
			<tr>
			<td width="40" nowrap><?=$i?></td>
			<td><a href="javascript:viewchild('<?=$row['cid']?>')" title="查看下级目录"><?=$row['cname']?></a></td>
			
			<!-- <td><?=$row['templateid']?></td> -->
			<td><?=$row['description']?></td>
			<td><?php if($row['display']==0)
						echo("<font color='#009933'>显示</font>");
					  else 
					    echo("<font color='#D14836'>隐藏</font>");
			    ?></td>
			 <td><?=$row['tag']?></td>
			<td><a href="javascript:editcol('<?=$row['cid']?>')">编辑</a>&nbsp;<a href="javascript:delcol('<?=$row['cid']?>') ">删除</a></td>
			</tr>
		<?php }?>
	</table></div>
</body>
</html>